package com.rxh.controller;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.rxh.pojo.finance.FinanceBusinessMoney;
import com.rxh.service.BusinessMoneyService;

/**
 * 
 * @author xuzm
 * @date 20180404
 *
 */
@Controller
@RequestMapping("/businessMoney")
public class BusinessMoneyController {
 
	
    @Autowired
    private BusinessMoneyService businessMoneyService;
    
    
    @RequestMapping("/getBusinessMoneyStatistics")
    @ResponseBody
    public Map<String, Object> getBusinessMoneyStatistics(@RequestBody Integer merId) {
    	
    	Map<String, Object> resultMap = new HashMap<String,Object>();
    	
    	FinanceBusinessMoney businessMoneyStatistics = businessMoneyService.queryBusinessMoneyStatistics(merId);
    	resultMap.put("businessMoneyStatistics", businessMoneyStatistics);
    	
    	return resultMap;
        
    }
    
	/**
	 * 获取商品详情
	 * @param merId
	 * @return
	 */
    @ResponseBody
    @RequestMapping(value="/getDetails")
    public Map<String, Object> getDetails(@RequestBody Integer merId) {

        return businessMoneyService.getBusinessMoneyStatistics(merId);
        
    }
    
    

    /**
     * 获取商户列表
     *
     * @return 初始化信息
     */
    @RequestMapping(value = "/getMerIdsInit")
    @ResponseBody
    public Map<String, Object> getMerIdsInit() {
        return businessMoneyService.getMerIdsInit();
    }


}
